package com.aiwiown.face.request;

import com.aiwiown.face.ApiMethod;
import com.aiwiown.face.ApiObject;
import com.aiwiown.face.ApiRequest;
import com.aiwiown.face.internal.util.RequestParamUtils;
import com.aiwiown.face.response.FaceSkeletonResponse;

import java.util.Map;

/**
 * 描述
 * 传入图片进行人体检测和骨骼关键点检测，返回人体14个关键点
 * 支持对图片中的所有人体进行骨骼检测
 * 图片要求
 * 图片格式：JPG(JPEG)
 * 图片像素尺寸：最小 100*100 像素，最大 4096*4096 像素
 * 图片文件大小：2 MB
 * 为了保证较好的识别结果，人体矩形框大小建议在200*200像素及以上
 * 调用URL
 * https://api-cn.faceplusplus.com/humanbodypp/v1/skeleton
 * @ClassName : FaceSkeletonRequest
 * @Description :
 * @Author : dbin0123
 * @Date: 2020-06-13 13:50
 */
public class FaceSkeletonRequest implements ApiRequest<FaceSkeletonResponse> {

    private String apiVersion = "v1";
    private static String apiUrl = "/skeleton";

    private String bizContent;
    private ApiObject bizModel = null;

    @Override
    public ApiMethod getApiMethod() {
        return ApiMethod.POST;
    }

    @Override
    public String getApiUrl() {
        return "/" + this.apiVersion + apiUrl;
    }

    @Override
    public Map<String, String> getTextParams() throws IllegalAccessException {
        return RequestParamUtils.getTextParams(this.bizModel);
    }

    @Override
    public Map<String, byte[]> getByteArrayParams() throws IllegalAccessException {
        return RequestParamUtils.getByteArrayParams(this.bizModel);
    }

    @Override
    public Class<FaceSkeletonResponse> getResponseClass() {
        return FaceSkeletonResponse.class;
    }

    @Override
    public String getApiVersion() {
        return this.apiVersion;
    }

    @Override
    public String getBizContent() {
        return this.bizContent;
    }

    public void setBizModel(ApiObject bizModel) {
        this.bizModel = bizModel;
    }

    @Override
    public String signVersion() {
        return null;
    }

    @Override
    public String getSignInfo(String apiKey, String secretKey) throws Exception {
        return null;
    }


}
